home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGASIC / BASFILES.LZH / FILESIZE.BAS < prev    next >
BASIC Source File  |  1988-09-10  |  574b  |  32 lines

  1. '$INCLUDE: 'QBTOOLS.INC'
  2. '' '$INCLUDE: 'qbtools.inc'
  3.  
  4.  
  5.  
  6. 'DIM fl$(512)
  7. '
  8. 'GetFiles fl$(), Count%, "????????", "???"
  9. '
  10. 'FOR j% = 1 TO Count%
  11. '   PRINT fl$(j%); " / "; FileSizeGet&(fl$(j%))
  12. 'NEXT j%
  13.  
  14. DEFSNG A-Z
  15. FUNCTION FileSizeGet& (FileName$)
  16.     Trim FileName$
  17.     IF FileExists%(FileName$) THEN
  18.         w% = FREEFILE
  19.         IF w% THEN
  20.             OPEN "r", w%, FileName$
  21.             FSize& = LOF(w%)
  22.             CLOSE w%
  23.             FileSizeGet& = FSize&
  24.         ELSE
  25.             FileSizeGet& = -2    '  Too Many Open Files
  26.         END IF
  27.     ELSE
  28.         FileSizeGet& = -1       '  File Does Not Exist
  29.     END IF
  30. END FUNCTION
  31.  
  32.